#!/bin/bash
#systemctl stop docker.socket docker
DIR_Backup=/mnt
dir_exclude="dev media mnt proc run sys lost+found ddbr tmp"
cd /
COPY_SRC=`ls`
echo "==============================================================="
echo "All files here:"
echo ${COPY_SRC}
echo "==============================================================="
echo 'Files below will be excluded:'
echo ${dir_exclude} 
echo "==============================================================="
#for src in ${COPY_SRC}; do
for src in ${COPY_SRC}; do
    if [[ ! "${dir_exclude[@]}"  =~ "${src}" ]]; then
        echo "backup [ ${src} ] ..."
        tar -cpf - ${src} | pv -s $(($(du -sk ${src} | awk '{print $1}')* 1024)) | gzip > ${DIR_Backup}/${src}.tar.gz
    fi
done